package com.xcx.robot.mirai.factory;

import com.xcx.robot.mirai.key.KeyWord;
import net.mamoe.mirai.contact.Contact;

/**
 * @Author: 邢晨旭
 * @Date: 2021/5/26 16:09
 * @Description:
 */
public interface BaseFacade {

    /**
     * 操作
     *
     * @param sender
     * @param group
     * @param content
     */
    void execute(Contact sender, Contact group, String content);

    /**
     * 获取关键词
     *
     * @return
     */
    KeyWord keyWord();

    default boolean keyWordVerify(KeyWord keyWord, String content) {
        return (keyWord.code == 1 && content.indexOf(keyWord.keyWord + " ") == 0) || (keyWord.code == 2 && keyWord.keyWord.equals(content));

    }
}
